﻿; (function (global) {

    'use strict';

    global.MatchModel = function MatchModel(gridModel) {
        this.elapsedTime = 0;
        this.gridModel = gridModel;
        this.difficulty = 'Easy';
    }

    MatchModel.revive = function (data) {
        var inst = new MatchModel();
        inst.elapsedTime = data.elapsedTime;
        inst.difficulty = data.difficulty;
        inst.gridModel = GridModel.revive(data.gridModel);
        return inst;
    }

    MatchModel.prototype.toJSON = function () {
        return {
            _t: 'MatchModel',
            elapsedTime: this.elapsedTime,
            gridModel: this.gridModel,
            difficulty: this.difficulty
        };
    }

}(this));